package com.xxxx.web.dto;

import com.xxxx.web.entity.*;
import com.xxxx.web.enums.*;
import com.xxxx.web.tools.dto.BaseDto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 出库明细表类
 */
@Data
public class StockOutDetDto extends BaseDto {


    /**
     * 商品
     */
    @JsonProperty("CargoId")
    private Integer CargoId;


    /**
     * 数量
     */
    @JsonProperty("Qty")
    private Double Qty;


    /**
     * 库位
     */
    @JsonProperty("WarehouseBinId")
    private Integer WarehouseBinId;


    /**
     * 仓库
     */
    @JsonProperty("WarehouseId")
    private Integer WarehouseId;


    /**
     * 出库单
     */
    @JsonProperty("StockOutId")
    private Integer StockOutId;

    @JsonProperty("WarehouseBinDto")
    private WarehouseBinDto WarehouseBinDto;

    @JsonProperty("WarehouseDto")
    private WarehouseDto WarehouseDto;

    @JsonProperty("CargoDto")
    private CargoDto CargoDto;

    @JsonProperty("StockOutDto")
    private StockOutDto StockOutDto;

    /**
     * 把出库明细表传输模型转换成出库明细表实体
     */
    public StockOutDet MapToEntity() throws InvocationTargetException, IllegalAccessException {
        StockOutDet StockOutDet = new StockOutDet();

        BeanUtils.copyProperties(StockOutDet, this);

        return StockOutDet;
    }

}
